<template>
  <div>
    <h1>{{ count }}</h1>
    <button @click="increment">按钮</button>
  </div>
</template>

<script>
export default {
    name:"Count",
    props:{num:Number},
    data(){
        return {
            count:0
        }
    },
    methods:{
        increment(){
            this.count+=this.num
        }
    }
}
</script>

<style scoped>
div {
  background-color: pink;
}
</style>